package org.howie.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


// OrderController
@RefreshScope
@RestController
@RequestMapping("/orderCon")
public class OrderController {

    @Value("${student.name}")
    private String name;
    @Value("${dog.name}")
    private String dogName;
    @Value("${aaa.bbb}")
    private String ab;
    @Value("${common.name}")
    private String cn;
    @Value("${commonservice2.name}")
    private String commonservice2name;
    @Value("${table.name}")
    private String extensionServiceName;
    @Value("${aaa.ccc:ccccccc}")
    private String noParam;

    @RequestMapping("/test")
    public String addOrder() {
        System.out.println(name);
        System.out.println(ab);
        System.out.println(cn);
        System.out.println(commonservice2name);
        System.out.println(extensionServiceName);
        System.out.println(noParam);
        return extensionServiceName;
    }

    @RequestMapping("/test1")
    public String addOrder1() {
        System.out.println(dogName);
        return dogName;
    }

    @RequestMapping("/test2")
    public String addOrder2() throws InterruptedException {
        Thread.sleep(3000);
        System.out.println(dogName);
        return dogName;
    }



//    @Autowired
//    private OrderService orderService;
//
//    @PostMapping("/add")
//    public Result addOrder(@RequestBody Order order) {
//        orderService.addOrder(order);
//        return Result.success();
//    }
//
//    @GetMapping("/list")
//    public Result getOrderList() {
//        List<Order> orderList = orderService.getOrderList();
//        return Result.success(orderList);
//    }
    // 省略其他方法
}